i2c_mux_sources = [
  'i2c_mux.cpp',
  'i2c_mux_abi.cpp',
  'interface/i_i2c_mux.cpp',
]

i2c_mux_headers = [
  'i2c_mux.h',
  'interface/i_i2c_mux.h',
]

install_headers(i2c_mux_headers, install_dir: install_inc_dir / 'bus/i2c_mux')

# 根据构建类型设置include路径
i2c_mux_include_dirs = [include_dirs, '..', '../..']

i2c_mux_lib = shared_library(
    'I2cMux',
    i2c_mux_sources,
    include_directories: i2c_mux_include_dirs,
    dependencies: [ libmcpp_deps, internal_dep],
    name_prefix: 'lib',
    name_suffix: 'so',
    install: true,
    install_dir: drivers_install_dir,
)

i2c_mux_dep = declare_dependency(
    link_with: i2c_mux_lib,
    dependencies: [libmcpp_deps, internal_dep],
)

if build_tests and meson_build
  custom_target(
    'copy_libI2cMux',
    output: 'copy_libI2cMux',
    command: ['cp', i2c_mux_lib.full_path(), drivers_install_dir],
    depends: i2c_mux_lib,
    build_by_default: true,
  )
endif